<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>sale.js</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            sale.js
        </h1>
        <ul class="files">
            
            <li>
                app/assets/javascripts/sale.js
                
            </li>
            <li>Last modified: 2017-02-27 13:44:02 +0800</li>
        </ul>
    </div>

    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>//= require jquery //= require jquery_ujs //= require jquery-2.1.1.min //=
require jasny-bootstrap.min //= require bootstrap-sprockets //= require
bootstrap.min //= require bootstrap-dialog //= require sidebar //= require
common //= require sale_app //= require jquery.serializejson //= require
bootstrap-datetimepicker.min //= require_tree ../templates/sales</p>

<p>// This is ? params(url) function getUrlParam(name) {</p>

<pre><code>var reg = new RegExp(&quot;(^|&amp;)&quot; + name + &quot;=([^&amp;]*)(&amp;|$)&quot;); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg);  //匹配目标参数
if (r != null) return unescape(r[2]); return null; //返回参数值</code></pre>

<p>}</p>

<p>// This is path params function getPathParam(name) {</p>

<pre><code>var  url= window.location.href
var  array = url.split(&#39;/&#39;);
for(var i =0; i &lt; array.length; i++){
    if(array[i]== name)
    return array[i+1]
}</code></pre>

<p>}</p>

<p>function getStoreId(){</p>

<pre><code>var id = getUrlParam(&quot;store_id&quot;)
return id
</code></pre>

<p>}</p>

<p>jQuery(function($){</p>

<pre><code>// toggle header profile
$(&quot;a.js-toggle-profile&quot;).on(&quot;click&quot;, function(){
  $(&quot;ul.dropdown-menu.extended.logout&quot;).toggle();
})</code></pre>

<p>})</p>

<p>$.ajaxSetup({</p>

<pre><code>headers: {
  &#39;X-CSRF-Token&#39;: $(&#39;meta[name=&quot;csrf-token&quot;]&#39;).attr(&#39;content&#39;)
}</code></pre>

<p>});</p>

    </div>
  


  


  
  


  


  

  



  

    

    

    


    


    <!-- Methods -->
              </div>

    </div>
  </body>
</html>
